import WQRequest from "@/service";
export function getPlanManagement(data) {
    return WQRequest.post({
        url: "plancyclemanagement/getsecondplandetaillist",
        data
    });
}

export function getQuipmentCode() {
    return WQRequest.get({
        url: "plancyclemanagement/getstructuretypecode"
    });
}

export function getPlanCycletype() {
    return WQRequest.get({
        url: "plancyclemanagement/getstructuretypeqi"
    });
}
export function getPlanState() {
    return WQRequest.get({
        url: "plancyclemanagement/getplanstate"
    });
}

//保养
export function getMaintain(data) {
    return WQRequest.post({
        url: "plancyclemanagement/getplandetailpagelist",
        data
    });
}

//计划类型
export function getPlanType() {
    return WQRequest.get({
        url: "plancyclemanagement/getplantype"
    });
}

//分派人员
export function getPersonnel(params) {
    return WQRequest.get({
        url: `plancyclemanagement/getplanper/${params.equipmentId}`
    });
}

//获取设备信息
export function getQuipment(params) {
    return WQRequest.get({
        url: `plancyclemanagement/getequipmentbyid/${params.equipmentId}`
    });
}

//获取生成计划明细截至日期
export function getDeadline(data) {
    return WQRequest.get({
        url: "plancyclemanagement/getmaxexecdatebystrategyid/" + data
    });
}

//生成计划明细
export function getPlandetail(data) {
    return WQRequest.post({
        url: "plancyclemanagement/createmaintainplandetail",
        data,
        timeout: 60 * 1000
    });
}

//修改日期
export function setDate(data) {
    return WQRequest.post({
        url: "plancyclemanagement/editsecondmaintainorderstate",
        data
    });
}

//批量修改日期
export function setBatchDate(data) {
    return WQRequest.post({
        url: "plancyclemanagement/editallsecondmaintainorderstatebydate",
        data
    });
}

//一级保养修改状态
export function setState(data) {
    return WQRequest.post({
        url: "plancyclemanagement/editfirstmaintainorderstate",
        data
    });
}

//一级保养批量修改状态
export function setBatchState(data) {
    return WQRequest.post({
        url: "plancyclemanagement/closeallfirstmaintainorderstatebyday",
        data
    });
}
